The GrpBuilder object contains the following methods:
Note: Some of the examples in this topic use the WScript.Sleep statement, which is not recommended for use when scripting in CygNet Studio. Use TheView EventTimer instead.
The CancelBuild method cancels any currently-running hierarchy build.
CancelBuild(iSecondsToWait As Integer) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
iSecondsToWait |
Yes |
The maximum number of seconds to wait for cancellation before returning. |
This method will hang for a maximum of iSecondsToWait before returning. If the time interval specified by iSecondsToWait expires before the build cancels, this method will return false.
Example
The following example starts to build a hierarchy and immediately cancels the build.
|
Sub GrpBuilder.StartBuildingHierarchy "CYGDEMO.GRP", "Navigation Hierarchy"
GrpBuilder.CancelBuild(5) End Sub |
The GetBuildResults method returns the results of the last build.
GetBuildResults() As String
Example
The following example builds a hierarchy and displays the results.
|
Sub GrpBuilder.StartBuildingHierarchy "CYGDEMO.GRP", "Navigation Hierarchy"
While GrpBuilder.IsBuilding() WScript.Sleep(100) Wend
Dim strMsg If GrpBuilder.WasBuildSuccessful() Then strMsg = GrpBuilder.GetBuildResults() Else strMsg = "Build failed for the following reason(s):" + vbCr + vbCr strMsg = strMsg + GrpBuilder.GetBuildResults() End If
MsgBox strMsg End Sub |
The IsBuilding method returns true if there is a build currently in process.
IsBuilding() As Boolean
Example
The following example builds a hierarchy and displays the results.
|
Sub GrpBuilder.StartBuildingHierarchy "CYGDEMO.GRP", "Navigation Hierarchy"
While GrpBuilder.IsBuilding() WScript.Sleep(100) Wend
Dim strMsg If GrpBuilder.WasBuildSuccessful() Then strMsg = GrpBuilder.GetBuildResults() Else strMsg = "Build failed for the following reason(s):" + vbCr + vbCr strMsg = strMsg + GrpBuilder.GetBuildResults() End If
MsgBox strMsg End Sub |
The StartBuildingHierarchy method starts building a specified hierarchy.
StartBuildingHierarchy(grpService As String, hierarchy As String) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
grpService |
Yes |
The GRP Site.Service to which to connect. |
|
hierarchy |
Yes |
The description of a Navigation Root Node. This Node must be of type Navigation Root (~V) and in the Root Group (R) category. |
Example
The following example builds a hierarchy and displays the results.
|
Sub GrpBuilder.StartBuildingHierarchy "CYGDEMO.GRP", "Navigation Hierarchy"
While GrpBuilder.IsBuilding() WScript.Sleep(100) Wend
Dim strMsg If GrpBuilder.WasBuildSuccessful() Then strMsg = GrpBuilder.GetBuildResults() Else strMsg = "Build failed for the following reason(s):" + vbCr + vbCr strMsg = strMsg + GrpBuilder.GetBuildResults() End If
MsgBox strMsg End Sub |
The WasBuildSuccessful method returns true if the last build completed successfully.
WasBuildSuccessful() As Boolean
Example
The following example builds a hierarchy and displays the results.
|
Sub GrpBuilder.StartBuildingHierarchy "CYGDEMO.GRP", "Navigation Hierarchy"
While GrpBuilder.IsBuilding() WScript.Sleep(100) Wend
Dim strMsg If GrpBuilder.WasBuildSuccessful() Then strMsg = GrpBuilder.GetBuildResults() Else strMsg = "Build failed for the following reason(s):" + vbCr + vbCr strMsg = strMsg + GrpBuilder.GetBuildResults() End If
MsgBox strMsg End Sub |